<layout name="Layout/layout"/>
    <script>
        $(function () {
        $('#tbkitemup').click(function () {
        var info = $('#tbkitemget').serialize();
        $.ajax({
        type: "POST",
        url: "{:U('Main/upGoodsApi')}",
        data: info,
        dataType: 'text',
        success: function (rsault) {
        var data = eval('(' + rsault + ')');
        if (data.status == '1') {
        return dialog.success(data.message);
        } else {
        return dialog.error(data.message);
        }
        }
        });
        })

        $('#jutqgup').click(function () {
        var info = $('#jutqgget').serialize();
        $.ajax({
        type: "POST",
        url: "{:U('Main/upGoodsApi')}",
        data: info,
        dataType: 'text',
        success: function (rsault) {
        var data = eval('(' + rsault + ')');
        if (data.status == '1') {
        return dialog.success(data.message);
        } else {
        return dialog.error(data.message);
        }
        }
        });

        })
          $('#favoritesitemup').click(function () {
        var info = $('#favoritesitemget').serialize();
        $.ajax({
        type: "POST",
        url: "{:U('Main/upGoodsApi')}",
        data: info,
        dataType: 'text',
        success: function (rsault) {
        var data = eval('(' + rsault + ')');
        if (data.status == '1') {
        return dialog.success(data.message);
        } else {
        return dialog.error(data.message);
        }
        }
        });
        })
        })
    </script>
    <div class="container-fulid">
        <div class="col-sm-2">
            <include file="Layout:slide"/>
            </div>
            <div class="col-sm-10 slid_right">
                <br/>
                <div class="whiteblock">
                    <div class="page-header" style="margin: 30px;">
                        <h3 class="text-primary">
                            淘宝客API参数设置
                            <small>
                                设置项
                            </small>
                        </h3>
                    </div>
                    <br/>
                    <div class="getfrom">
                        <form id="tbkitemget">
                            <table class="table table-bordered">
                                <tr>
                                    <th colspan="8">
                                        taobao.tbk.item.get (淘宝客商品查询)
                                        <a
                                            href="http://open.taobao.com/docs/api.htm?spm=a219a.7629065.0.0.4KXBPi&apiId=24515"
                                            target="_blank">
                                            相关手册
                                        </a>
                                    </th>
                                </tr>
                                <tr>
                                    <td>
                                        <label>
                                            所在城市
                                        </label>
                                        <input type="text" class="form-control" name="itemloc" placeholder="空为全国"
                                            value="{$itemget.itemloc}"/>
                                        </td>
                                        <td>
                                            <label>
                                                排序
                                            </label>
                                            <select name="sort" class="form-control">
                                                <option value="_des" selected="selected">
                                                    降序
                                                </option>
                                                <option value="_asc">
                                                    升序
                                                </option>
                                                <option value="total_sales">
                                                    销量
                                                </option>
                                                <option value="tk_rate">
                                                    淘客佣金比率
                                                </option>
                                                <option value="tk_total_sales">
                                                    累计推广量
                                                </option>
                                                <option value="tk_total_commi">
                                                    总支出佣金
                                                </option>
                                            </select>
                                        </td>
                                        <td>
                                            <label class="text-danger">
                                                折扣价下限
                                            </label>
                                            <input type="text" class="form-control" name="start_price"
                                                value="{$itemget.start_price}"/>
                                            </td>
                                            <td>
                                                <label class="text-danger">
                                                    折扣价上限
                                                </label>
                                                <input type="text" class="form-control" name="end_price" value="{$itemget.end_price}"/>
                                            </td>
                                            <td>
                                                <label class="text-danger">
                                                    佣金比上限
                                                </label>
                                                <input type="text" class="form-control" name="start_tk_rate" value="{$itemget.start_tk_rate}"/>
                                            </td>
                                            <td>
                                                <label class="text-danger">
                                                    佣金比下限
                                                </label>
                                                <input type="text" class="form-control" name="end_tk_rate"  value="{$itemget.end_tk_rate}"/>
                                            </td>
                                            <td>
                                                <label>
                                                    开始页
                                                </label>
                                                <input type="text" class="form-control" name="page_no"  value="{$itemget.page_no}"/>
                                            </td>
                                            <td>
                                                <label>
                                                    每页数量
                                                </label>
                                                <input type="text" class="form-control" name="page_size" value="{$itemget.page_size}"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="8" class="text-right">
                                                <input type="hidden" name="id" value="1"/>
                                                <button type="button" class="btn btn-primary btn-sm" id="tbkitemup">
                                                    提交本项
                                                </button>
                                            </td>
                                        </tr>
                                    </table>
                                </form>
                                <br/>
                                <form  id="jutqgget">
                                    <table class="table table-bordered">
                                        <tr>
                                            <th colspan="6">
                                                taobao.tbk.ju.tqg.get (淘抢购api)
                                                <a href="http://open.taobao.com/docs/api.htm?spm=a219a.7395905.0.0.R27VXi&apiId=27543" target="_blank">
                                                    相关手册
                                                </a>
                                            </th>
                                        </tr>
                                        <tr>
                                            <td>
                                                <label class="text-danger">
                                                    推广位id : adzone_id
                                                </label>
                                                <input type="text" class="form-control" name="adzoneid" value="{$jutqgget.adzoneid}" />
                                            </td>
                                            <td>
                                                <label class="text-danger">
                                                    最早开团时间
                                                </label>
                                                <input type="text" class="form-control" name="start_time" value="{$jutqgget.start_time}" />
                                            </td>
                                            <td>
                                                <label class="text-danger" >
                                                    最晚开团时间
                                                </label>
                                                <input type="text" class="form-control" name="end_time" value="{$jutqgget.end_time}"/>
                                            </td>
                                            <td>
                                                <label>
                                                    初始页
                                                </label>
                                                <input type="text" class="form-control" name="page_no" value="{$jutqgget.page_no}" />
                                            </td>
                                            <td>
                                                <label>
                                                    页数量 :默认96，1~96
                                                </label>
                                                <input type="text" class="form-control" name="page_size" value="{$jutqgget.page_size}" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="6" class="text-right">
                                                <input type="hidden" name="id" value="2"/>
                                            </input>
                                            <button type="button" class="btn btn-primary btn-sm" id="jutqgup">
                                                提交本项
                                            </button>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                            <br/>
                            <form id="favoritesitemget">
                                <table class="table table-bordered">
                                    <tr>
                                        <th colspan="3">
                                            taobao.tbk.uatm.favorites.item.get (获取淘宝联盟选品库的宝贝信息)
                                            <a href="http://open.taobao.com/docs/api.htm?spm=a219a.7395905.0.0.oHH3tF&apiId=26619" target="_bplank">
                                                相关手册
                                            </a>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <label class="text-danger">
                                                推广位id : adzone_id
                                            </label>
                                            <input type="text" class="form-control" name="adzoneid" value="{$favoritesitemup.adzoneid}" />
                                        </td>
                                        <td>
                                            <label>
                                                初始页
                                            </label>
                                            <input type="text" class="form-control" name="page_no" value="{$favoritesitemup.page_no}" />
                                        </td>
                                        <td>
                                            <label>
                                                页数量，默认20，1~100 <span class="text-danger">建议按 1个分类 * 8计算</span>
                                            </label>
                                            <input type="text" class="form-control" name="page_size" value="{$favoritesitemup.page_size}" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" class="text-right">
                                        <input type="hidden" name="id" value="3"></input>
                                            <button type="button" class="btn btn-primary btn-sm" id="favoritesitemup">提交本项</button>
                                        </td>
                                    </tr>
                                </table>
                            </form>
                        </div>
                    </div>
                    <br/>
                </div>
                <div class="clearfix">
                </div>
            </div>
